package com.xls.boxlibrary.network;



import com.xls.boxlibrary.duihuanjibi.JinBiNetWorkUtil;
import com.xls.boxlibrary.entity.AppsRulesEntity;
import com.xls.boxlibrary.entity.DuiHuanJiBiInfoEntity;
import com.xls.boxlibrary.entity.JiFenDuiHuanJiLuEntity;
import com.xls.boxlibrary.entity.JiFenMingXiEntity;
import com.xls.boxlibrary.entity.JiFenTiXianBiliEntity;
import com.xls.boxlibrary.entity.PageEntity;
import com.xls.boxlibrary.entity.TiXianJiLuEntity;
import com.xls.boxlibrary.entity.UserEntity;

import java.util.ArrayList;
import java.util.Map;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface IApiserver {
    @FormUrlEncoded
    @POST("/api/coins/coinsExchange2")
    Observable<HttpRequest<String>>  coinsExchange(@Field("coins")String numStr,
                                                   @Field("unionId")String unionId,
                                                   @Field("openId")String openId,
                                                   @Field("headImageUrl")String headImageUrl,
                                                   @Field("nickname")String nickname,
                                                   @Field("packageName")String packageName,
                                                   @Field("fromBox")String fromBox);
    @FormUrlEncoded
    @POST("/api/apps/getAppRules")
    Observable<HttpRequest<ArrayList<AppsRulesEntity>>> getAppRules(@Field("appId")String appId, @Field("packageName")String packageName);

    @FormUrlEncoded
    @POST("/api/score/scoreExchange2")
    Observable<HttpRequest<DuiHuanJiBiInfoEntity>> getScoreExchange(@Field("rulesId")String rulesId,
                                                                    @Field("typeId")String typeId,
                                                                    @Field("appId")String appId,
                                                                    @Field("packageName")String packageName,
                                                                    @Field("unionId")String unionId,
                                                                    @Field("openId")String openId,
                                                                    @Field("headImageUrl")String headImageUrl,
                                                                    @Field("nickname")String nickname,
                                                                    @Field("fromBox")String fromBox);

    @FormUrlEncoded
    @POST("/api/user/getUserLevel")
    Observable<HttpRequest<UserEntity>>  getUserLevel(@Field("appId")String appId ,@Field("packageName")String packageName);

    @FormUrlEncoded
    @POST("/api/score/getScoreExchangeRateRules")
    Observable<HttpRequest<ArrayList<JiFenTiXianBiliEntity>>> getScoreExchangeRateRules(@Field("appId")String appId , @Field("packageName")String packageName);

    @FormUrlEncoded
    @POST("/api/apps/getAccountByAppId")
    Observable<HttpRequest<JiFenMingXiEntity>> getAccountByAppId(@Field("appId")String appId, @Field("packageName")String packageName);

    @FormUrlEncoded
    @POST("/api/user/login")
    Observable<HttpRequest<String>> getLogin(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("/api/coins/getMyCoinsExchangeRecords")
    Observable<HttpRequest<PageEntity<TiXianJiLuEntity>>>  getMyCoinsExchangeRecords(@Field("pageSize")int pageSize, @Field("pageNum") int pageNum);

    @FormUrlEncoded
    @POST("/api/score/getMyScoreExchangeRecords")
    Observable<HttpRequest<PageEntity<JiFenDuiHuanJiLuEntity>>> getMyScoreExchangeRecords(@Field("pageSize")int pageSize, @Field("pageNum") int pageNum, @Field("appId") String appId,@Field("typeId") String typeId);


    @FormUrlEncoded
    @POST("/api/user/fkCheck")
    Observable<HttpRequest<String>> fkCheck(@FieldMap Map<String, String>  str);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/user/reg")
    Observable<HttpRequest<String>> userReg(@Body RequestBody data);

//    @Headers({"Content-Type: application/json","Accept: application/json"})
    @FormUrlEncoded
    @POST("/api/coins/getOauthConfigHFBF")
    Observable<HttpRequest<JinBiNetWorkUtil.HuiFuData>> getOauthConfig(@FieldMap Map<String, Object> json);
}
